{{template "admin/public/head.html" .}}
<section>
	<aside>
		{{template "admin/public/nav.html" .}}
	</aside>
	<article>
		<div class="content">
			<div class="instructions">
					<dl>
						<dt>{{.title}}</dt>
						<dd>
							本系统的关键词列表。<br>
							<p>在这里您可以自由设置关键词。</p>
							<p>关键词设置之后在添加新闻和产品时只需点击选择即可。</p>
							<p>关键词分为产品和新闻两类,添加时请先选择类别</p>
							<p>设置为热门的关键词将在搜索页面中显示</p>
						</dd>
					</dl>
				</div>
				<form action="" method="get" autocomplete="on" class="form">
				<table class="table1">
					<!-- 控制表格宽度  横向合并 colspan="1"  竖向合并 rowspan="3" -->
					<thead><th width="10%"></th><th width="15%"></th><th width="10%"></th><th width="15%"></th><th width="10%"></th><th width="15%"></th><th width="10%"></th><th width="15%"></th></thead>
					<tr>
						<td class="genre">关键词名称</td>
						<td colspan="3">
							<input type="text" class="input95" placeholder="请输入关键词名称!" name="title" value="{{.info.title}}">
						</td>
						<td class="genre">关键词类型</td>
						<td colspan="3">
							<label class="demo--label"><input class="demo--radio" type="radio" name="type" value="1" {{if .info}}{{if eq .info.type "1"}}checked{{end}}{{else}}checked{{end}}><span class="demo--radioInput"></span>新闻</label>
							<label class="demo--label"><input class="demo--radio" type="radio" name="type" value="0" {{if .info}}{{if eq .info.type "0"}}checked{{end}}{{end}}><span class="demo--radioInput"></span>产品</label>
						</td>
					</tr>
					<tr>
						<td class="genre">排序</td>
						<td colspan="3">
							<input type="number" class="input95" placeholder="请输入排序!" name="sort" value="{{.info.sort}}">
						</td>
						<td class="genre">关键词类型</td>
						<td colspan="3">
							<label class="demo--label"><input class="demo--radio" type="radio" name="hot" value="1" {{if .info}}{{if eq .info.hot "1"}}checked{{end}}{{else}}checked{{end}}><span class="demo--radioInput"></span>设为热门</label>
							<label class="demo--label"><input class="demo--radio" type="radio" name="hot" value="0" {{if .info}}{{if eq .info.hot "0"}}checked{{end}}{{end}}><span class="demo--radioInput"></span>非热门</label>
						</td>
					</tr>
					<input type="hidden" name="id" value="{{.info.id}}">
					</form>
					<tr class="trbutton">
						<td colspan="2"><button type="button" class="button">保存</button></td>
						<td colspan="6">
							<p>
								<i class="iconfont">&#xe649;</i> 请检查内容确认发布的内容没有涉及传播谣言、政治话题或违反广告法夸大宣传产品等。
							</p>
							<div class="help">帮助
								<div class="help_qr"><img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/all/qr-code.jpg" alt=""></div>
							</div>
						</td>
					</tr>
				</table>
		</div>
	</article>
</section>

<footer><!-- 系统监控内容 --></footer>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/jquery.jedate.min.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/toast.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/uppic.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/xcConfirm.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/app.js"></script>
<script>
	$('.button').click(function(){
		if (!$('input[name="title"]').val()){
			window.wxc.xcConfirm("请输入关键词","info"); return false;
		}
		var form=$('form').serialize();
		$.ajax({
			url:window.location.href,
			data:form,
			type:'post',
			success:function(res){
				if(res==1){
					 window.wxc.xcConfirm("保存成功","success",{onClose:function(){
                        window.location.href = document.referrer
                    }})
				}else {
					 window.wxc.xcConfirm("保存失败,请重试!","error")
				}
			}
		})
	})
</script>
</body>
</html>
